package com.dong.util;

import javax.swing.plaf.synth.Region;
import java.util.Scanner;

public class Test {
    public static int query(int[] test,int age){
        for (int i : test) {
            if(i == age){
                return test[0];
            }
        }
        return 0;
    }
    public static void main(String[] args) {
            int[] step1 = {1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31};
            int[] step2 = {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31};
            int[] step3 = {4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31};
            int[] step4 = {8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31};
            int[] step5 = {16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
            Scanner input = new Scanner(System.in);
            System.out.println("请输入年龄：");
            int guess = input.nextInt();
            int sum = query(step1,guess)+query(step2,guess)+query(step3,guess)+query(step4,guess)+query(step5,guess);
            System.out.println("猜出最终年龄：");
            System.out.println(query(step1,guess)+"+"+query(step2,guess)+"+"+query(step3,guess)+"+"+query(step4,guess)+"+"+query(step5,guess)+"="+sum);
    }
}
